package nl.wubinator.aeve.connectors;

import nl.wubinator.aeve.exceptions.AEveConnectionException;
import nl.wubinator.aeve.models.standard.alliancelist.AllianceList;
import nl.wubinator.aeve.models.standard.serverstatus.ServerStatus;
import nl.wubinator.aeve.models.standard.skilltree.SkillTree;
import nl.wubinator.aeve.url.StandardUrls;
import nl.wubinator.aeve.xmlconverters.standard.AllianceListConverter;
import nl.wubinator.aeve.xmlconverters.standard.ServerStatusConverter;
import nl.wubinator.aeve.xmlconverters.standard.SkillTreeConverter;

public class StandardConnector extends ConnectorBase {
	
	/**
	 * Use this method to retrieve the complete skillTree as a <code>SkillTree</code> class
	 * 
	 * @return
	 * @throws AEveConnectionException
	 */
	public final SkillTree getSkillTree() throws AEveConnectionException {
		SkillTreeConverter converter = new SkillTreeConverter();
		
		connect(StandardUrls.SKILL_TREE);
		
		return (SkillTree) converter.getResult();
	}
	
	
	public final void getCertificatesTree() throws AEveConnectionException {
		
	}
	
	public final AllianceList getAllianceList() throws AEveConnectionException {
		AllianceListConverter converter = new AllianceListConverter();
		
		connect(StandardUrls.ALLIANCE_LIST, null, converter);
		
		return (AllianceList) converter.getResult();
	}
	
	/**
	 * Use this method to return the status of the Tranquility server
	 * 
	 * @return
	 * @throws AEveConnectionException
	 */
	public final ServerStatus getServerStatus() throws AEveConnectionException {
		ServerStatusConverter converter = new ServerStatusConverter();

		connect(StandardUrls.SERVER_STATUS);
		
		return (ServerStatus) converter.getResult();
	}
	
	public final void getCharacterPortrait() throws AEveConnectionException {
		
	}
}
